import request from '@/utils/request'

// ---------------------------------------------------------------请求部门数据
export const getDepartments = function() {
  return request.get('/company/department')
}

// ---------------------------------------------------------------请求部门信息
export const getEmployeeSimple = function() {
  return request.get('/sys/user/simple')
}

// ---------------------------------------------------------------添加部门
export const addDepartments = function(data) {
  return request.post('/company/department', data)
}

// ---------------------------------------------------------------删除部门
export const delDepartments = function(id) {
  return request.delete(`/company/department/${id}`)
}

// ---------------------------------------------------------------获取当前编辑部门的信息
export const getDepartmentById = function(id) {
  return request.get(`/company/department/${id}`)
}

// ---------------------------------------------------------------修改部门
export const updateDepartments = function(data) {
  return request.put(`/company/department/${data.id}`, data)
}
